import { http } from "@/utils/http";
import { baseUrlApi } from "@/api/utils";
type Result = {
  current_page: number;
  result?: any;
  per_page?: number;
  total?: number;
  data?: any;
};
type ResultCreate = {
  code: number;
  msg: string;
  result: any;
};
type ResultDelete = {
  code: number;
  msg: string;
};
type Show = {
  code: number;
  msg: string;
  result?: any;
};
/** 菜单列表 */
export const getRbacMenuListApi = (params?: object) => {
  return http.request<Result>("get", baseUrlApi+"/rbacMenu/list", {
    params
  });
};
/** 菜单添加 */
export const createRbacMenuApi = (data?: object) => {
  return http.request<ResultCreate>("post", baseUrlApi+"/rbacMenu/store", {
    data
  });
};
/** 菜单修改 */
export const updateRbacMenuApi = (data?: object) => {
  return http.request<ResultCreate>("put", baseUrlApi+"/rbacMenu/update", {
    data
  });
};
/** 菜单删除 */
export const delRbacMenuApi = (params?: object) => {
  return http.request<ResultDelete>("delete", baseUrlApi+"/rbacMenu/delete", {
    params
  });
};
/** 菜单详情 */
export const getRbacMenuShowApi = (params?: object) => {
  return http.request<Show>("get", baseUrlApi+"/rbacMenu/show", {
    params
  });
};
/** 菜单选择 */
export const getRbacMenuListTreeApi = (params?: object) => {
  return http.request<Result>("get", baseUrlApi+"/rbacMenu/listTree", {
    params
  });
};